package routers

import (
	"api_admin_server/internal/controllers"
	"api_admin_server/internal/middleware"

	"github.com/gin-gonic/gin"
)

func RegisteBase(engine *gin.Engine) {
	authApi := engine.Group("auth").Use(middleware.VerifyToken())
	baseController := new(controllers.BaseControoler)
	// authApi.GET("/algorithm/config", baseController.GetAlgorithmConfig)
	// authApi.POST("/algorithm/config/update", baseController.UpdateAlgorithmConfig)
	authApi.POST("/algorithm/config/clear", baseController.ClearAlgorithmConfig)
	authApi.POST("/fashion/create", baseController.CreateFashion)
	authApi.POST("/fashion/create/batch", baseController.BatchCreateFashion)
	authApi.GET("/fashion/batch/lastnum", baseController.GetBatchCreateFashionLastNum)
	authApi.POST("/fashion/update", baseController.UpdateFashion)
	authApi.POST("/fashion/list", baseController.GetFashionList)
	authApi.GET("/fashion/detail", baseController.GetFashionDetail)
	authApi.GET("/fashion/obj/split", baseController.SplitObj)
	//更新obj文件
	authApi.Any("/fashion/obj/update", baseController.UpdateFashionObj)
	//款式上下架
	authApi.POST("/fashion/offonline", baseController.OffonFashion)
	//款式删除
	authApi.POST("/fashion/delete", baseController.DeleteFashion)
	//款式推荐设置
	authApi.POST("/fashion/recommended/setting", baseController.SetFashionRecommended)
	//模拟机器人登录，获取机器人的token，为了检测使用
	authApi.POST("/fashion/robot/login", baseController.RobotLogin)
	//复制母板工艺
	authApi.POST("/fashion/craft/copy", baseController.CopySuperFashionCraft)
	//获取dxf内部线信息
	authApi.GET("/fashion/dxf/info", baseController.GetDxfInfo)

	authApi.POST("/fashion/dxf/update", baseController.UpdateFashionDxf)
	authApi.POST("/fashion/algorithm_param/update", baseController.UpdateFashionAlgorithmParam)
	//裁片删除
	authApi.POST("/fashion/cutpart/delete", baseController.DeleteCutpart)
	authApi.GET("/fashion/cutpart/detail", baseController.GetCutpartDetail)
	authApi.POST("/fashion/cutpart/update", baseController.UpdateCutpart)
	authApi.POST("/fashion/cutpart/fabric/update", baseController.UpdateCutpartFabric)

	//面料
	authApi.POST("/fabric/create", baseController.CreateFabric)
	authApi.POST("/fabric/update", baseController.UpdateFabric)
	authApi.GET("/fabric/detail", baseController.GetFabricDetail)
	authApi.POST("/fabric/delete", baseController.DeleteFabric)
	authApi.GET("/fabric/list", baseController.GetFabricList)

	//纹样
	authApi.POST("/pattern/create", baseController.CreatePattern)
	authApi.POST("/pattern/update", baseController.UpdatePattern)
	authApi.GET("/pattern/detail", baseController.GetPatternDetail)
	authApi.POST("/pattern/delete", baseController.DeletePattern)
	authApi.POST("/pattern/list", baseController.GetPatternList)
}
